 <nav class="menu">
    
    
    <?php if ($categories) { ?>
<div id="menu">
  
  <ul <?php //echo $detect->isMobile() && $is_responsive ? 'class="mobile-nav"' : ''; ?>>
            <li class="open">
             <span class="menu-icon">
                <span></span>
                <span></span>
                <span></span>
              </span>
              <?php //echo isset($this->document->journal_mobile_menu_title2) && $this->document->journal_mobile_menu_title2 ? $this->document->journal_mobile_menu_title2 : 'Menu'; ?>
            </li>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
</div>
<?php } ?>
   
   
        
            

            



</nav>